package com.yfeng.common.utils;

import java.util.UUID;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * 生成唯一主键
 *
 * @author ly
 */
public class UUIDHexGenerator {
	private static final Log log = LogFactory.getLog(UUIDHexGenerator.class);
    public synchronized static long getUUID() {
        return UUID.randomUUID().getMostSignificantBits();
    }

    public synchronized static String getUUIDString() {
        return UUID.randomUUID().toString();
    }

    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            log.info("-------------:" + getUUIDString());
        }
    }
}
